Reference: paramProc |
paramProc informs VirtualDub of the behavior of your filter, including output frame size, buffer requirements, and filter lag.
Prototype |
long paramProc(FilterActivation *fa, const FilterFunctions *ff); Parameters: fa Pointer to filter activation structure ff Pointer to callback function structure Return value: Filter behavior is indicated by bit flags. FILTERPARAM_SWAP_BUFFERS: Filter requires separate input and output buffers FILTERPARAM_NEEDS_LAST: Filter needs last-source buffer (fa->last) FILTERPARAM_HAS_LAG(cnt): Filter output lags input by (cnt) frames fa->dst should be set to the required destination buffer parameters. Exceptions: No exceptions should be thrown from this function. Requirements: Function may be omitted. Default action is to assume FILTERPARAM_SWAP_BUFFERS and that the output frame size is the same as the input.
Remarks |
paramProc can be called relatively frequently when the user is arranging filter order, so it should not take a long time to execute. The function should also be robust to improper frame sizes, such as 1x2 bitmaps -- frame size validation should be handled in startProc instead.
![]() |
![]() Be careful when setting fa->dst.offset. In a two-buffer filter, the destination buffer offset should be set to zero, unless the filter creates a larger image and returns a subrectangle of it. However, in an in-place filter, the destination offset must be at least as much as the source offset, and if the destination image is the same size, it must be exactly the same. Setting it to zero in an in-place filter can result in x1/y2 cropping not working correctly in VirtualDub's filter chain. |
VirtualDub external filter SDK 1.05 | ©1999-2001 Avery Lee <phaeron@virtualdub.org> |